Skip to content

Improve and refactor patches.cjs in tx/ocl/shared#172

Merged
grahamegrieve merged 1 commit intomainfrom
feature/ocl-extensional-composition
Mar 19, 2026
Merged

Improve and refactor patches.cjs in tx/ocl/shared#172
grahamegrieve merged 1 commit intomainfrom
feature/ocl-extensional-composition

Conversation

@italomacedo
Copy link
Collaborator

This pull request introduces improvements to the OCL ValueSet expansion and job queue prioritization, along with adjustments to cold cache loading and compose reconstruction. The main focus is on ensuring user-requested jobs are prioritized, reconstructing ValueSet compose data when missing, and grouping concepts by system during expansion. Several legacy behaviors and patches are commented out or refactored for clarity and maintainability.

Job Queue Prioritization

  • Added a userRequested flag to job objects in OCLBackgroundJobQueue, ensuring user-requested jobs are prioritized at the front of the queue (tx/ocl/jobs/background-queue.cjs). [1] [2]
  • Propagated the userRequested flag when scheduling background expansions in OCLValueSetProvider, so cache hits triggered by user actions are prioritized (tx/ocl/vs-ocl.cjs). [1] [2]

ValueSet Compose Reconstruction and Cold Cache Handling

  • When loading ValueSets from cold cache, if compose.include is missing, it is reconstructed from expansion.contains to ensure completeness and consistency (tx/ocl/vs-ocl.cjs).
  • During concept expansion, concepts are grouped by their system and compose.include is populated for each system, improving the structure and accuracy of ValueSet expansions (tx/ocl/vs-ocl.cjs). [1] [2] [3]

Legacy and Patch Adjustments

  • The patch for restricting OCL ValueSet expansion to only explicitly listed codes in compose.include.code is commented out, reverting to the original expansion behavior (tx/ocl/shared/patches.cjs, tx/ocl/vs-ocl.cjs). [1] [2]
  • Several legacy behaviors and compose reconstruction logic are commented out for clarity and maintainability, including #ensureComposeIncludes calls and preferred source handling (tx/ocl/vs-ocl.cjs). [1] [2] [3] [4] [5] [6] [7] [8]

Indexing and Cache Management

  • Improved cold-cache expansion indexing logic to only index ValueSets if they are new or the same object, preventing unnecessary invalidation of hydrated expansions (tx/ocl/vs-ocl.cjs).

Copy link
Contributor

@grahamegrieve grahamegrieve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@grahamegrieve grahamegrieve merged commit 95d5a8c into main Mar 19, 2026
7 checks passed
@grahamegrieve grahamegrieve deleted the feature/ocl-extensional-composition branch March 19, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants